package com.sailorj.controller;

import com.sailorj.entity.SysRole;
import com.sailorj.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: springLab
 * @description:
 * @author: Huang_shengjun
 * @create: 2020-06-26 21:20
 **/
@CrossOrigin  //后端解决跨域方法注解
@RestController
@RequestMapping("/role")
public class SysRoleController {

    @Autowired
    private SysRoleService sysRoleService;

    @RequestMapping(value = "/getSysRole",method = RequestMethod.GET)
    public SysRole getSysRoleById(String id){
        return sysRoleService.getSysRoleByUsername(id);
    }

}
